<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/axios.min.js"></script>
</head>

<body>
  <button id="get">get</button>
  <button id="post">post</button>
  <button id="aaa">axios_get</button>
  <button id="bbb">axios_post</button>
  <script>
    get.onclick = () => {
      axios.get('http://www.liulongbin.top:3006/api/get', { params: { name: 'zp', age: 20 } })
        .then(res => {
          console.log(res)
        })
    }

    post.onclick = () => {
      axios.post('http://www.liulongbin.top:3006/api/post', { data: { name: 'zp', age: 20 } })
        .then(res => {
          console.log(res)
        })
    }

    aaa.onclick = () => {
      axios({
        method: 'get',
        url: 'http://www.liulongbin.top:3006/api/get',
        params: { name: 'zp', age: 20 }
      }).then(res => {
        console.log(res)
      })
    }


    bbb.onclick = () => {
      axios({
        method: 'post',
        url: 'http://www.liulongbin.top:3006/api/post',
        data: { name: 'zp', age: 20 }
      }).then(res => {
        console.log(res)
      })
    }
  </script>
</body>

</html>